// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * IndexEvent generated by hbm2java
 */
@Entity
@Table(name = "index_event", catalog = "magento", uniqueConstraints = @UniqueConstraint(columnNames = {
		"type", "entity", "entity_pk" }))
public class IndexEvent implements java.io.Serializable {

	private Long eventId;
	private String type;
	private String entity;
	private Long entityPk;
	private Date createdAt;
	private String oldData;
	private String newData;
	private Set indexProcessEvents = new HashSet(0);

	public IndexEvent() {
	}

	public IndexEvent(String type, String entity, Date createdAt) {
		this.type = type;
		this.entity = entity;
		this.createdAt = createdAt;
	}

	public IndexEvent(String type, String entity, Long entityPk,
			Date createdAt, String oldData, String newData,
			Set indexProcessEvents) {
		this.type = type;
		this.entity = entity;
		this.entityPk = entityPk;
		this.createdAt = createdAt;
		this.oldData = oldData;
		this.newData = newData;
		this.indexProcessEvents = indexProcessEvents;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "event_id", unique = true, nullable = false)
	public Long getEventId() {
		return this.eventId;
	}

	public void setEventId(Long eventId) {
		this.eventId = eventId;
	}

	@Column(name = "type", nullable = false, length = 64)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "entity", nullable = false, length = 64)
	public String getEntity() {
		return this.entity;
	}

	public void setEntity(String entity) {
		this.entity = entity;
	}

	@Column(name = "entity_pk")
	public Long getEntityPk() {
		return this.entityPk;
	}

	public void setEntityPk(Long entityPk) {
		this.entityPk = entityPk;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_at", nullable = false, length = 19)
	public Date getCreatedAt() {
		return this.createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	@Column(name = "old_data", length = 16777215)
	public String getOldData() {
		return this.oldData;
	}

	public void setOldData(String oldData) {
		this.oldData = oldData;
	}

	@Column(name = "new_data", length = 16777215)
	public String getNewData() {
		return this.newData;
	}

	public void setNewData(String newData) {
		this.newData = newData;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "indexEvent")
	public Set getIndexProcessEvents() {
		return this.indexProcessEvents;
	}

	public void setIndexProcessEvents(Set indexProcessEvents) {
		this.indexProcessEvents = indexProcessEvents;
	}

}
